<script setup>
import { ref } from 'vue'
import PlantCard from '@/components/PlantCard.vue'

const shopPlants = ref([
  {
    id: 1,
    name: '多肉植物',
    species: 'Echeveria',
    level: 1,
    health: 100,
    water: 80,
    light: 90,
    price: 50,
    image: 'https://images.pexels.com/photos/4505456/pexels-photo-4505456.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'
  },
  {
    id: 2,
    name: '绿萝',
    species: 'Epipremnum aureum',
    level: 1,
    health: 100,
    water: 70,
    light: 60,
    price: 30,
    image: 'https://images.pexels.com/photos/3644742/pexels-photo-3644742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'
  },
  {
    id: 3,
    name: '仙人掌',
    species: 'Cactaceae',
    level: 1,
    health: 100,
    water: 40,
    light: 95,
    price: 45,
    image: 'https://images.pexels.com/photos/1903965/pexels-photo-1903965.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'
  }
])
</script>

<template>
  <div class="shop-container">
    <div class="shop-header">
      <h1>盆栽商店</h1>
      <div class="shop-filters">
        <button class="filter-btn active">全部</button>
        <button class="filter-btn">室内植物</button>
        <button class="filter-btn">室外植物</button>
        <button class="filter-btn">观花植物</button>
      </div>
    </div>
    
    <div class="plants-grid">
      <div v-for="plant in shopPlants" :key="plant.id" class="shop-item">
        <PlantCard :plant="plant" />
        <button class="buy-btn">
          购买 ({{ plant.price }} 金币)
        </button>
      </div>
    </div>
  </div>
</template>

<style scoped>
.shop-container {
  min-height: calc(100vh - 84px);
}

.shop-header {
  margin-bottom: 32px;
}

.shop-header h1 {
  font-size: 28px;
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 20px;
}

.shop-filters {
  display: flex;
  gap: 12px;
}

.filter-btn {
  padding: 8px 16px;
  border: none;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  color: #666;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: #42b983;
  color: white;
}

.plants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 20px 0;
}

.shop-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.buy-btn {
  padding: 12px;
  border: none;
  background: #42b983;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.buy-btn:hover {
  background: #3aa876;
}
</style> 